/* Integration points (quadratures)
   Jan Stebel
*/

#ifndef _CONSTPOINT_H__
#define _CONSTPOINT_H__

#include "intpoint.h"




/** Constant approximation on linear mesh */
template<unsigned int dim>
class ConstPoint : public IntPoint<dim>
{
protected:
	using IntPoint<dim>::imesh;
	using IntPoint<dim>::GSF;
	using IntPoint<dim>::SF;
	using IntPoint<dim>::x;
	using IntPoint<dim>::x_a;
	using IntPoint<dim>::J;
	using IntPoint<dim>::J_a;


	bool isLinear() { return true; };

public:
	ConstPoint() {};
	ConstPoint(Mesh *mesh, const Quadrature<dim> *q) { IntPoint<dim>::init(mesh, q, 1); };
	void setGSF();
	void setSF();
	void setX(int elem, eval_t E);
	void calcJ(eval_t E);
	inline int getMeshNdof() { return imesh->getNvolumes()+imesh->getNfaces()+imesh->getNedges(); }
	int mapDof(int e, int n);
	int mapDof (int elem, int dof, int iParent);
};







#endif
